package validators

import (
	"regexp"

	"github.com/go-playground/validator/v10"
)

func MobileValidation(fl validator.FieldLevel) bool {
	mobile := fl.Field().String()
	if mobile == "" {
		return false
	}
	mobileReg := regexp.MustCompile(`^1[3-9]\d{9}$`)
	return mobileReg.MatchString(mobile)
}
